package net.entelijan.cobean.examples.showcase.config.table;

import javax.swing.JButton;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.JTextField;

import net.entelijan.cobean.examples.util.ExamplesUtil;
import net.entelijan.scf.DefaultShowcasePanel;
import net.miginfocom.swing.MigLayout;

public class ConfigTablePanel extends DefaultShowcasePanel {

	private JTextField booksFilterInputText = new JTextField();

	private JTable booksTable = new JTable();

	private JButton showSelecedBook = new JButton("Selected Book");

	private JButton showAllBooks = new JButton("All Books");

	private JButton selectFirstBookButton = new JButton("Select First Book");

	private JButton selectThirdBookButton = new JButton("Select Third Book");

	private JButton deleteBookButton = new JButton("Delete Book");

	private static final long serialVersionUID = 1L;

	public ConfigTablePanel() {
		super();
		setLayout(new MigLayout());
		add(this.booksFilterInputText, "w max, wrap");
		add(new JScrollPane(this.booksTable), "w max, h max, wrap");
		add(ExamplesUtil.createButtonsPanel(130, this.showSelecedBook,
				this.showAllBooks, this.selectFirstBookButton,
				this.selectThirdBookButton, this.deleteBookButton));
	}

	public JTable getBooksTable() {
		return booksTable;
	}

	public void setBooksTable(JTable table) {
		this.booksTable = table;
	}

	public JButton getShowSelecedBook() {
		return showSelecedBook;
	}

	public void setShowSelecedBook(JButton showSelectionButton) {
		this.showSelecedBook = showSelectionButton;
	}

	public JTextField getBooksFilterInputText() {
		return booksFilterInputText;
	}

	public void setBooksFilterInputText(JTextField filterText) {
		this.booksFilterInputText = filterText;
	}

	public JButton getSelectFirstBookButton() {
		return selectFirstBookButton;
	}

	public void setSelectFirstBookButton(JButton select1Button) {
		this.selectFirstBookButton = select1Button;
	}

	public JButton getSelectThirdBookButton() {
		return selectThirdBookButton;
	}

	public void setSelectThirdBookButton(JButton select3Button) {
		this.selectThirdBookButton = select3Button;
	}

	public JButton getShowAllBooks() {
		return showAllBooks;
	}

	public void setShowAllBooks(JButton showAllBooks) {
		this.showAllBooks = showAllBooks;
	}

	public JButton getDeleteBookButton() {
		return deleteBookButton;
	}

	public void setDeleteBookButton(JButton deletBookButton) {
		this.deleteBookButton = deletBookButton;
	}

}
